#ifndef TESTSTATE_H_INCLUDED
#define TESTSTATE_H_INCLUDED

#include <string>
#include "GameState.h"
#include "Player.h"
#include "Emitter.h"
#include "TestEntity.h"
#include "Connector.h"
#include "ComboEntity.h"
#include "Animation.h"
#include "SingBlock.h"
#include "TextEntity.h"
#include <vector>
#include <Box2D/Box2D.h>
#include <TGUI/TGUI.hpp>
#include "Utility.h"
#include "GameEngine.h"
#include "MyContactListener.h"
#include "IntroState.h"


class TestState : public GameState
{
public:

    static b2World* world;
    static std::vector<TestEntity*> EntityList;

	void Init(sf::RenderWindow& window);
	void Cleanup();

	void Pause();
	void Resume();

	void Events(GameEngine* game, sf::RenderWindow& window);
	void Update(GameEngine* game, sf::RenderWindow& window);
	void Render(GameEngine* game, sf::RenderWindow& window);

	static TestState* Instance() {
		return &m_TestState;
	}

protected:
	TestState() { }

private:
    sf::Texture bg;
    sf::Sprite background;

	static TestState m_TestState;

    float scale = 1.0;
    float speedFactor = 500;
    float velocityLimit = 6;

    sf::View view;
    sf::View view2;
    tgui::Gui gui;

    bool cameraCentered = false;

    Player* player;
    TestEntity* selectedEntity;

    std::set<TestEntity*> ForRemoval;
    std::vector<Emitter*> EmitterList;

    sf::Time emitTime;
    int yLimit = 1000;
    int timeLimit = 2000;

    float fps;
    sf::Clock clock;

    TextEntity text;
    static const int FONTSIZE = 16;

    sf::Event event;
    tgui::ComboBox::Ptr c1;
    tgui::Checkbox::Ptr c2;
    tgui::EditBox::Ptr c3;
    tgui::EditBox::Ptr c4;
    tgui::EditBox::Ptr c5;
};

#endif // TESTSTATE_H_INCLUDED
